import Vue from 'vue'
import VueRouter from 'vue-router'
// 公共页面
import Login from '../views/Login/Login.vue'
import identification from '../views/Login/index.vue'
import register from '../views/Register/register.vue'
import forgetPassword from '../views/ForgetPassword/forgetPassword.vue'
import test from '../views/index.vue'

Vue.use(VueRouter)

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}
export const routes = [{
        path: '/',
        name: 'Login',
        component: Login,
        hidden: true
    },
    {
        path: '/identification',
        name: 'identification',
        component: identification,
        hidden: true
    },
    {
        path: '/register',
        name: 'register',
        component: register,
        hidden: true
    },
    {
        path: '/forgetPassword',
        name: 'forgetPassword',
        component: forgetPassword,
        hidden: true
    },
    {
        path: '/home',
        name: 'test',
        component: test,
        hidden: true
    },
]

export const asyncRoutes = [

]

const router = new VueRouter({
    routes
})

export default router